package com.atguigu.guli.service.base.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.hibernate.validator.internal.metadata.provider.MetaDataProvider;

import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author: jinlu
 * @Date: 2022/2/20
 * @Time: 16:58
 * @Version:
 */
public class CommonMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        metaObject.setValue("gmtCreate" , new Date());
        metaObject.setValue("gmtModified" , new Date());
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        metaObject.setValue("gmtModified" , new Date());
    }
}
